package com.yunshang.shoppingmall.mapper;

import com.yunshang.shoppingmall.entity.Order;
import com.yunshang.shoppingmall.entity.OrderToData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface OrderMapper {
    int deleteByPrimaryKey(Integer orderId);

    int insert(Order record);

    int insertSelective(Order record);
    List<Order> selectOrderActivityOne(String userId);
    Order selectByPrimaryKey(Integer orderId);
    Order selectByNo(String orderNo);
    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);
    int updateOrderStatus(@Param("orderStatus") String orderStatus,@Param("orderNo") String orderNo);
    int updateOrderStatus1(@Param("orderStatus") String orderStatus,@Param("orderList") List<String> orderList);
    List<Order> selectAll();
    List<Order> selectOrderCheck(Date ptime);
    List<Order> selectByUserId(String userId);
    List<Order> selectDate(@Param("t1") Date t1, @Param("t2") Date t2);
    List<Order> selectQuery(@Param("orderStatus") String orderStatus,
                            @Param("payStatus") String payStatus,
                            @Param("deliveStatus") String deliveStatus,
                            @Param("keywords") String keywords,
                            @Param("userNo") String userNo);
    //根据用户编号查询已经支付订单的订单
    List<Order> selectPayOrderByUserNoId(OrderToData orderToData);

    //首次消费
    Order selectFirstConsume(int userNoId);
    int upOrderFrom(@Param("nos") List<String> nos,@Param("exporttime") Date exporttime);

    int updateOrderAddressId(@Param("orderAddressId") String orderAddressId,@Param("orderNo") String orderNo);
    //按时间查询用户订单详细
    List<Order> selectOrderListByPayTime(OrderToData orderToData);
    List<Order> selectListOrderCartByNo(String orderNo);
}